<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/api.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<title>CGridView</title>
</head>

<body>
<div id="apiPage">

<div id="apiHeader">
<a href="http://www.yiiframework.com">Yii Framework</a> v1.1.17 Class Reference
</div><!-- end of header -->

<div id="content">
<h1>CGridView</h1>
<div id="nav">
<a href="index.html">All Packages</a>
| <a href="#properties">Properties</a>
| <a href="#methods">Methods</a>
</div>

<table class="summaryTable docClass">
<colgroup>
	<col class="col-name" />
	<col class="col-value" />
</colgroup>
<tr>
  <th>Package</th>
  <td><a href="index.html#zii.widgets.grid">zii.widgets.grid</a></td>
</tr>
<tr>
  <th>Inheritance</th>
  <td>class CGridView &raquo;
<a href="CBaseListView.html">CBaseListView</a> &raquo;
<a href="CWidget.html">CWidget</a> &raquo;
<a href="CBaseController.html">CBaseController</a> &raquo;
<a href="CComponent.html">CComponent</a></td>
</tr>
<tr>
  <th>Since</th>
  <td>1.1</td>
</tr>
<tr>
  <th>Source Code</th>
  <td><a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php">framework/zii/widgets/grid/CGridView.php</a></td>
</tr>
</table>

<div id="classDescription">
CGridView displays a list of data items in terms of a table.
<br/><br/>
Each row of the table represents the data of a single data item, and a column usually represents
an attribute of the item (some columns may correspond to complex expression of attributes or static text).
<br/><br/>
CGridView supports both sorting and pagination of the data items. The sorting
and pagination can be done in AJAX mode or normal page request. A benefit of using CGridView is that
when the user browser disables JavaScript, the sorting and pagination automatically degenerate
to normal page requests and are still functioning as expected.
<br/><br/>
CGridView should be used together with a <a href="IDataProvider.html">data provider</a>, preferably a
<a href="CActiveDataProvider.html">CActiveDataProvider</a>.
<br/><br/>
The minimal code needed to use CGridView is as follows:
<br/><br/>
<pre>
$dataProvider=new CActiveDataProvider('Post');

$this-&gt;widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=&gt;$dataProvider,
));
</pre>
<br/><br/>
The above code first creates a data provider for the <code>Post</code> ActiveRecord class.
It then uses CGridView to display every attribute in every <code>Post</code> instance.
The displayed table is equiped with sorting and pagination functionality.
<br/><br/>
In order to selectively display attributes with different formats, we may configure the
<a href="CGridView.html#columns">CGridView::columns</a> property. For example, we may specify only the <code>title</code>
and <code>create_time</code> attributes to be displayed, and the <code>create_time</code>
should be properly formatted to show as a time. We may also display the attributes of the related
objects using the dot-syntax as shown below:
<br/><br/>
<pre>
$this-&gt;widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=&gt;$dataProvider,
    'columns'=&gt;array(
        'title',          // display the 'title' attribute
        'category.name',  // display the 'name' attribute of the 'category' relation
        'content:html',   // display the 'content' attribute as purified HTML
        array(            // display 'create_time' using an expression
            'name'=&gt;'create_time',
            'value'=&gt;'date(&quot;M j, Y&quot;, $data-&gt;create_time)',
        ),
        array(            // display 'author.username' using an expression
            'name'=&gt;'authorName',
            'value'=&gt;'$data-&gt;author-&gt;username',
        ),
        array(            // display a column with &quot;view&quot;, &quot;update&quot; and &quot;delete&quot; buttons
            'class'=&gt;'CButtonColumn',
        ),
    ),
));
</pre>
<br/><br/>
Please refer to <a href="CGridView.html#columns">columns</a> for more details about how to configure this property.</div>
<a name="properties"></a>

<div class="summary docProperty">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="actionPrefix">
  <td><a href="CWidget.html#actionPrefix-detail">actionPrefix</a></td>
  <td>string</td>
  <td>the prefix to the IDs of the <a href="CGridView.html#actions">actions</a>.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="afterAjaxUpdate">
  <td><a href="CGridView.html#afterAjaxUpdate-detail">afterAjaxUpdate</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked after a successful AJAX response is received.</td>
  <td>CGridView</td>
</tr>
<tr id="ajaxType">
  <td><a href="CGridView.html#ajaxType-detail">ajaxType</a></td>
  <td>string</td>
  <td>the type ('GET' or 'POST') of the AJAX requests.</td>
  <td>CGridView</td>
</tr>
<tr id="ajaxUpdate">
  <td><a href="CGridView.html#ajaxUpdate-detail">ajaxUpdate</a></td>
  <td>mixed</td>
  <td>the ID of the container whose content may be updated with an AJAX response.</td>
  <td>CGridView</td>
</tr>
<tr id="ajaxUpdateError">
  <td><a href="CGridView.html#ajaxUpdateError-detail">ajaxUpdateError</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked if an AJAX update error occurs.</td>
  <td>CGridView</td>
</tr>
<tr id="ajaxUrl">
  <td><a href="CGridView.html#ajaxUrl-detail">ajaxUrl</a></td>
  <td>mixed</td>
  <td>the URL for the AJAX requests should be sent to.</td>
  <td>CGridView</td>
</tr>
<tr id="ajaxVar">
  <td><a href="CGridView.html#ajaxVar-detail">ajaxVar</a></td>
  <td>string</td>
  <td>the name of the GET variable that indicates the request is an AJAX request triggered
by this widget.</td>
  <td>CGridView</td>
</tr>
<tr id="baseScriptUrl">
  <td><a href="CGridView.html#baseScriptUrl-detail">baseScriptUrl</a></td>
  <td>string</td>
  <td>the base script URL for all grid view resources (eg javascript, CSS file, images).</td>
  <td>CGridView</td>
</tr>
<tr id="beforeAjaxUpdate">
  <td><a href="CGridView.html#beforeAjaxUpdate-detail">beforeAjaxUpdate</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked before an AJAX update occurs.</td>
  <td>CGridView</td>
</tr>
<tr id="blankDisplay">
  <td><a href="CGridView.html#blankDisplay-detail">blankDisplay</a></td>
  <td>string</td>
  <td>the text to be displayed in an empty grid cell.</td>
  <td>CGridView</td>
</tr>
<tr id="columns">
  <td><a href="CGridView.html#columns-detail">columns</a></td>
  <td>array</td>
  <td>grid column configuration.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="controller">
  <td><a href="CWidget.html#controller-detail">controller</a></td>
  <td><a href="CController.html">CController</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="cssFile">
  <td><a href="CGridView.html#cssFile-detail">cssFile</a></td>
  <td>string</td>
  <td>the URL of the CSS file used by this grid view.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="dataProvider">
  <td><a href="CBaseListView.html#dataProvider-detail">dataProvider</a></td>
  <td><a href="IDataProvider.html">IDataProvider</a></td>
  <td>the data provider for the view.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="emptyCssClass">
  <td><a href="CBaseListView.html#emptyCssClass-detail">emptyCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the container of the <a href="CGridView.html#emptyText">emptyText</a> property.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="emptyTagName">
  <td><a href="CBaseListView.html#emptyTagName-detail">emptyTagName</a></td>
  <td>string</td>
  <td>the HTML tag name for the container of the <a href="CGridView.html#emptyText">emptyText</a> property.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="emptyText">
  <td><a href="CBaseListView.html#emptyText-detail">emptyText</a></td>
  <td>string</td>
  <td>the message to be displayed when <a href="CGridView.html#dataProvider">dataProvider</a> does not have any data.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="enableHistory">
  <td><a href="CGridView.html#enableHistory-detail">enableHistory</a></td>
  <td>boolean</td>
  <td>whether to leverage the {@link https://developer.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="enablePagination">
  <td><a href="CBaseListView.html#enablePagination-detail">enablePagination</a></td>
  <td>boolean</td>
  <td>whether to enable pagination.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="enableSorting">
  <td><a href="CBaseListView.html#enableSorting-detail">enableSorting</a></td>
  <td>boolean</td>
  <td>whether to enable sorting.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="filter">
  <td><a href="CGridView.html#filter-detail">filter</a></td>
  <td><a href="CModel.html">CModel</a></td>
  <td>the model instance that keeps the user-entered filter data.</td>
  <td>CGridView</td>
</tr>
<tr id="filterCssClass">
  <td><a href="CGridView.html#filterCssClass-detail">filterCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the table row element containing all filter input fields.</td>
  <td>CGridView</td>
</tr>
<tr id="filterPosition">
  <td><a href="CGridView.html#filterPosition-detail">filterPosition</a></td>
  <td>string</td>
  <td>whether the filters should be displayed in the grid view.</td>
  <td>CGridView</td>
</tr>
<tr id="filterSelector">
  <td><a href="CGridView.html#filterSelector-detail">filterSelector</a></td>
  <td>string</td>
  <td>the jQuery selector of filter input fields.</td>
  <td>CGridView</td>
</tr>
<tr id="formatter">
  <td><a href="CGridView.html#formatter-detail">formatter</a></td>
  <td><a href="CFormatter.html">CFormatter</a></td>
  <td>the formatter instance.</td>
  <td>CGridView</td>
</tr>
<tr id="hasFooter">
  <td><a href="CGridView.html#hasFooter-detail">hasFooter</a></td>
  <td>boolean</td>
  <td>whether the table should render a footer.</td>
  <td>CGridView</td>
</tr>
<tr id="hideHeader">
  <td><a href="CGridView.html#hideHeader-detail">hideHeader</a></td>
  <td>boolean</td>
  <td>whether to hide the header cells of the grid.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="htmlOptions">
  <td><a href="CBaseListView.html#htmlOptions-detail">htmlOptions</a></td>
  <td>array</td>
  <td>the HTML options for the view container tag.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="id">
  <td><a href="CWidget.html#id-detail">id</a></td>
  <td>string</td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="itemsCssClass">
  <td><a href="CBaseListView.html#itemsCssClass-detail">itemsCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the container of all data item display.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="loadingCssClass">
  <td><a href="CGridView.html#loadingCssClass-detail">loadingCssClass</a></td>
  <td>string</td>
  <td>the CSS class name that will be assigned to the widget container element
when the widget is updating its content via AJAX.</td>
  <td>CGridView</td>
</tr>
<tr id="nullDisplay">
  <td><a href="CGridView.html#nullDisplay-detail">nullDisplay</a></td>
  <td>string</td>
  <td>the text to be displayed in a data cell when a data value is null.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="owner">
  <td><a href="CWidget.html#owner-detail">owner</a></td>
  <td><a href="CBaseController.html">CBaseController</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="pager">
  <td><a href="CBaseListView.html#pager-detail">pager</a></td>
  <td>array|string</td>
  <td>the configuration for the pager.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="pagerCssClass">
  <td><a href="CBaseListView.html#pagerCssClass-detail">pagerCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the pager container.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="rowCssClass">
  <td><a href="CGridView.html#rowCssClass-detail">rowCssClass</a></td>
  <td>array</td>
  <td>the CSS class names for the table body rows.</td>
  <td>CGridView</td>
</tr>
<tr id="rowCssClassExpression">
  <td><a href="CGridView.html#rowCssClassExpression-detail">rowCssClassExpression</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every table body row and whose result
is used as the CSS class name for the row.</td>
  <td>CGridView</td>
</tr>
<tr id="rowHtmlOptionsExpression">
  <td><a href="CGridView.html#rowHtmlOptionsExpression-detail">rowHtmlOptionsExpression</a></td>
  <td>string</td>
  <td>a PHP expression that is evaluated for every table body row and whose result
is used as additional HTML attributes for the row.</td>
  <td>CGridView</td>
</tr>
<tr id="selectableRows">
  <td><a href="CGridView.html#selectableRows-detail">selectableRows</a></td>
  <td>integer</td>
  <td>the number of table body rows that can be selected.</td>
  <td>CGridView</td>
</tr>
<tr id="selectionChanged">
  <td><a href="CGridView.html#selectionChanged-detail">selectionChanged</a></td>
  <td>string</td>
  <td>a javascript function that will be invoked after the row selection is changed.</td>
  <td>CGridView</td>
</tr>
<tr id="showTableOnEmpty">
  <td><a href="CGridView.html#showTableOnEmpty-detail">showTableOnEmpty</a></td>
  <td>boolean</td>
  <td>whether to display the table even when there is no data.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="skin">
  <td><a href="CWidget.html#skin-detail">skin</a></td>
  <td>mixed</td>
  <td>the name of the skin to be used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="summaryCssClass">
  <td><a href="CBaseListView.html#summaryCssClass-detail">summaryCssClass</a></td>
  <td>string</td>
  <td>the CSS class name for the summary text container.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="summaryTagName">
  <td><a href="CBaseListView.html#summaryTagName-detail">summaryTagName</a></td>
  <td>string</td>
  <td>the HTML tag name for the container of the <a href="CGridView.html#summaryText">summaryText</a> property.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="summaryText">
  <td><a href="CBaseListView.html#summaryText-detail">summaryText</a></td>
  <td>string</td>
  <td>the summary text template for the view.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="tagName">
  <td><a href="CBaseListView.html#tagName-detail">tagName</a></td>
  <td>string</td>
  <td>the tag name for the view container.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="template">
  <td><a href="CBaseListView.html#template-detail">template</a></td>
  <td>string</td>
  <td>the template to be used to control the layout of various sections in the view.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="updateSelector">
  <td><a href="CGridView.html#updateSelector-detail">updateSelector</a></td>
  <td>string</td>
  <td>the jQuery selector of the HTML elements that may trigger AJAX updates when they are clicked.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="viewPath">
  <td><a href="CWidget.html#viewPath-detail">viewPath</a></td>
  <td>string</td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
</table>
</div>
<a name="methods"></a>

<div class="summary docMethod">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="__call">
  <td><a href="CComponent.html#__call-detail">__call()</a></td>
  <td>Calls the named method which is not a class method.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__construct">
  <td><a href="CWidget.html#__construct-detail">__construct()</a></td>
  <td>Constructor.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="__get">
  <td><a href="CComponent.html#__get-detail">__get()</a></td>
  <td>Returns a property value, an event handler list or a behavior based on its name.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__isset">
  <td><a href="CComponent.html#__isset-detail">__isset()</a></td>
  <td>Checks if a property value is null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__set">
  <td><a href="CComponent.html#__set-detail">__set()</a></td>
  <td>Sets value of a component property.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__unset">
  <td><a href="CComponent.html#__unset-detail">__unset()</a></td>
  <td>Sets a component property to be null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="actions">
  <td><a href="CWidget.html#actions-detail">actions()</a></td>
  <td>Returns a list of actions that are used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="asa">
  <td><a href="CComponent.html#asa-detail">asa()</a></td>
  <td>Returns the named behavior object.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehavior">
  <td><a href="CComponent.html#attachBehavior-detail">attachBehavior()</a></td>
  <td>Attaches a behavior to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehaviors">
  <td><a href="CComponent.html#attachBehaviors-detail">attachBehaviors()</a></td>
  <td>Attaches a list of behaviors to the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachEventHandler">
  <td><a href="CComponent.html#attachEventHandler-detail">attachEventHandler()</a></td>
  <td>Attaches an event handler to an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="beginCache">
  <td><a href="CBaseController.html#beginCache-detail">beginCache()</a></td>
  <td>Begins fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginClip">
  <td><a href="CBaseController.html#beginClip-detail">beginClip()</a></td>
  <td>Begins recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginContent">
  <td><a href="CBaseController.html#beginContent-detail">beginContent()</a></td>
  <td>Begins the rendering of content that is to be decorated by the specified view.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginWidget">
  <td><a href="CBaseController.html#beginWidget-detail">beginWidget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="canGetProperty">
  <td><a href="CComponent.html#canGetProperty-detail">canGetProperty()</a></td>
  <td>Determines whether a property can be read.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="canSetProperty">
  <td><a href="CComponent.html#canSetProperty-detail">canSetProperty()</a></td>
  <td>Determines whether a property can be set.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="createWidget">
  <td><a href="CBaseController.html#createWidget-detail">createWidget()</a></td>
  <td>Creates a widget and initializes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="detachBehavior">
  <td><a href="CComponent.html#detachBehavior-detail">detachBehavior()</a></td>
  <td>Detaches a behavior from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehaviors">
  <td><a href="CComponent.html#detachBehaviors-detail">detachBehaviors()</a></td>
  <td>Detaches all behaviors from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachEventHandler">
  <td><a href="CComponent.html#detachEventHandler-detail">detachEventHandler()</a></td>
  <td>Detaches an existing event handler.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehavior">
  <td><a href="CComponent.html#disableBehavior-detail">disableBehavior()</a></td>
  <td>Disables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehaviors">
  <td><a href="CComponent.html#disableBehaviors-detail">disableBehaviors()</a></td>
  <td>Disables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehavior">
  <td><a href="CComponent.html#enableBehavior-detail">enableBehavior()</a></td>
  <td>Enables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehaviors">
  <td><a href="CComponent.html#enableBehaviors-detail">enableBehaviors()</a></td>
  <td>Enables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="endCache">
  <td><a href="CBaseController.html#endCache-detail">endCache()</a></td>
  <td>Ends fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endClip">
  <td><a href="CBaseController.html#endClip-detail">endClip()</a></td>
  <td>Ends recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endContent">
  <td><a href="CBaseController.html#endContent-detail">endContent()</a></td>
  <td>Ends the rendering of content.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endWidget">
  <td><a href="CBaseController.html#endWidget-detail">endWidget()</a></td>
  <td>Ends the execution of the named widget.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="evaluateExpression">
  <td><a href="CComponent.html#evaluateExpression-detail">evaluateExpression()</a></td>
  <td>Evaluates a PHP expression or callback under the context of this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getController">
  <td><a href="CWidget.html#getController-detail">getController()</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getEventHandlers">
  <td><a href="CComponent.html#getEventHandlers-detail">getEventHandlers()</a></td>
  <td>Returns the list of attached event handlers for an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="getFormatter">
  <td><a href="CGridView.html#getFormatter-detail">getFormatter()</a></td>
  <td>Returns the formatter instance. Defaults to the 'format' application component.</td>
  <td>CGridView</td>
</tr>
<tr id="getHasFooter">
  <td><a href="CGridView.html#getHasFooter-detail">getHasFooter()</a></td>
  <td>Returns whether the table should render a footer.
This is true if any of the <a href="CGridView.html#columns">columns</a> has a true <a href="CGridColumn.html#hasFooter">CGridColumn::hasFooter</a> value.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="getId">
  <td><a href="CWidget.html#getId-detail">getId()</a></td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getOwner">
  <td><a href="CWidget.html#getOwner-detail">getOwner()</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewFile">
  <td><a href="CWidget.html#getViewFile-detail">getViewFile()</a></td>
  <td>Looks for the view script file according to the view name.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewPath">
  <td><a href="CWidget.html#getViewPath-detail">getViewPath()</a></td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="hasEvent">
  <td><a href="CComponent.html#hasEvent-detail">hasEvent()</a></td>
  <td>Determines whether an event is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasEventHandler">
  <td><a href="CComponent.html#hasEventHandler-detail">hasEventHandler()</a></td>
  <td>Checks whether the named event has attached handlers.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasProperty">
  <td><a href="CComponent.html#hasProperty-detail">hasProperty()</a></td>
  <td>Determines whether a property is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="init">
  <td><a href="CGridView.html#init-detail">init()</a></td>
  <td>Initializes the grid view.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="raiseEvent">
  <td><a href="CComponent.html#raiseEvent-detail">raiseEvent()</a></td>
  <td>Raises an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="registerClientScript">
  <td><a href="CGridView.html#registerClientScript-detail">registerClientScript()</a></td>
  <td>Registers necessary client scripts.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="render">
  <td><a href="CWidget.html#render-detail">render()</a></td>
  <td>Renders a view.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="renderContent">
  <td><a href="CBaseListView.html#renderContent-detail">renderContent()</a></td>
  <td>Renders the main content of the view.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderEmptyText">
  <td><a href="CBaseListView.html#renderEmptyText-detail">renderEmptyText()</a></td>
  <td>Renders the empty message when there is no data.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderFile">
  <td><a href="CBaseController.html#renderFile-detail">renderFile()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr id="renderFilter">
  <td><a href="CGridView.html#renderFilter-detail">renderFilter()</a></td>
  <td>Renders the filter.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="renderInternal">
  <td><a href="CBaseController.html#renderInternal-detail">renderInternal()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr id="renderItems">
  <td><a href="CGridView.html#renderItems-detail">renderItems()</a></td>
  <td>Renders the data items for the grid view.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="renderKeys">
  <td><a href="CBaseListView.html#renderKeys-detail">renderKeys()</a></td>
  <td>Renders the key values of the data in a hidden tag.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderPager">
  <td><a href="CBaseListView.html#renderPager-detail">renderPager()</a></td>
  <td>Renders the pager.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr class="inherited" id="renderSummary">
  <td><a href="CBaseListView.html#renderSummary-detail">renderSummary()</a></td>
  <td>Renders the summary text.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="renderTableBody">
  <td><a href="CGridView.html#renderTableBody-detail">renderTableBody()</a></td>
  <td>Renders the table body.</td>
  <td>CGridView</td>
</tr>
<tr id="renderTableFooter">
  <td><a href="CGridView.html#renderTableFooter-detail">renderTableFooter()</a></td>
  <td>Renders the table footer.</td>
  <td>CGridView</td>
</tr>
<tr id="renderTableHeader">
  <td><a href="CGridView.html#renderTableHeader-detail">renderTableHeader()</a></td>
  <td>Renders the table header.</td>
  <td>CGridView</td>
</tr>
<tr id="renderTableRow">
  <td><a href="CGridView.html#renderTableRow-detail">renderTableRow()</a></td>
  <td>Renders a table body row.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="run">
  <td><a href="CBaseListView.html#run-detail">run()</a></td>
  <td>Renders the view.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
<tr id="setFormatter">
  <td><a href="CGridView.html#setFormatter-detail">setFormatter()</a></td>
  <td>Sets the formatter instance</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="setId">
  <td><a href="CWidget.html#setId-detail">setId()</a></td>
  <td>Sets the ID of the widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="widget">
  <td><a href="CBaseController.html#widget-detail">widget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
</table>
</div>
<div class="summary docMethod">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="createDataColumn">
  <td><a href="CGridView.html#createDataColumn-detail">createDataColumn()</a></td>
  <td>Creates a <a href="CDataColumn.html">CDataColumn</a> based on a shortcut column specification string.</td>
  <td>CGridView</td>
</tr>
<tr id="initColumns">
  <td><a href="CGridView.html#initColumns-detail">initColumns()</a></td>
  <td>Creates column objects and initializes them.</td>
  <td>CGridView</td>
</tr>
<tr id="renderDataCell">
  <td><a href="CGridView.html#renderDataCell-detail">renderDataCell()</a></td>
  <td>A seam for people extending CGridView to be able to hook onto the data cell rendering process.</td>
  <td>CGridView</td>
</tr>
<tr class="inherited" id="renderSection">
  <td><a href="CBaseListView.html#renderSection-detail">renderSection()</a></td>
  <td>Renders a section.</td>
  <td><a href="CBaseListView.html">CBaseListView</a></td>
</tr>
</table>
</div>
<a name="events"></a>

<h2>Property Details</h2>
<div class="detailHeader" id="afterAjaxUpdate-detail">
afterAjaxUpdate<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$afterAjaxUpdate</b>;</div>

<p>a javascript function that will be invoked after a successful AJAX response is received.
The function signature is <code>function(id, data)</code> where 'id' refers to the ID of the grid view,
'data' the received ajax response data.</p>


<div class="detailHeader" id="ajaxType-detail">
ajaxType<span class="detailHeaderTag">
property
 (available since v1.1.14)
</span>
</div>

<div class="signature">
public string <b>$ajaxType</b>;</div>

<p>the type ('GET' or 'POST') of the AJAX requests. If not set, 'GET' will be used.
You can set this to 'POST' if you are filtering by many fields at once and have a problem with GET query string length.
Note that in POST mode direct links and <a href="CGridView.html#enableHistory">enableHistory</a> feature may not work correctly!</p>


<div class="detailHeader" id="ajaxUpdate-detail">
ajaxUpdate<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public mixed <b>$ajaxUpdate</b>;</div>

<p>the ID of the container whose content may be updated with an AJAX response.
Defaults to null, meaning the container for this grid view instance.
If it is set false, it means sorting and pagination will be performed in normal page requests
instead of AJAX requests. If the sorting and pagination should trigger the update of multiple
containers' content in AJAX fashion, these container IDs may be listed here (separated with comma).</p>


<div class="detailHeader" id="ajaxUpdateError-detail">
ajaxUpdateError<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$ajaxUpdateError</b>;</div>

<p>a javascript function that will be invoked if an AJAX update error occurs.
<br/><br/>
The function signature is <code>function(xhr, textStatus, errorThrown, errorMessage)</code>
<ul>
<li><code>xhr</code> is the XMLHttpRequest object.</li>
<li><code>textStatus</code> is a string describing the type of error that occurred.
Possible values (besides null) are "timeout", "error", "notmodified" and "parsererror"</li>
<li><code>errorThrown</code> is an optional exception object, if one occurred.</li>
<li><code>errorMessage</code> is the CGridView default error message derived from xhr and errorThrown.
Useful if you just want to display this error differently. CGridView by default displays this error with an javascript.alert()</li>
</ul>
Note: This handler is not called for JSONP requests, because they do not use an XMLHttpRequest.
<br/><br/>
Example (add in a call to CGridView):
<pre>
 ...
 'ajaxUpdateError'=&gt;'function(xhr,ts,et,err,id){ $(&quot;#&quot;+id).text(err); }',
 ...
</pre></p>


<div class="detailHeader" id="ajaxUrl-detail">
ajaxUrl<span class="detailHeaderTag">
property
 (available since v1.1.8)
</span>
</div>

<div class="signature">
public mixed <b>$ajaxUrl</b>;</div>

<p>the URL for the AJAX requests should be sent to. <a href="CHtml.html#normalizeUrl">CHtml::normalizeUrl()</a> will be
called on this property. If not set, the current page URL will be used for AJAX requests.</p>


<div class="detailHeader" id="ajaxVar-detail">
ajaxVar<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$ajaxVar</b>;</div>

<p>the name of the GET variable that indicates the request is an AJAX request triggered
by this widget. Defaults to 'ajax'. This is effective only when <a href="CGridView.html#ajaxUpdate">ajaxUpdate</a> is not false.</p>


<div class="detailHeader" id="baseScriptUrl-detail">
baseScriptUrl<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$baseScriptUrl</b>;</div>

<p>the base script URL for all grid view resources (eg javascript, CSS file, images).
Defaults to null, meaning using the integrated grid view resources (which are published as assets).</p>


<div class="detailHeader" id="beforeAjaxUpdate-detail">
beforeAjaxUpdate<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$beforeAjaxUpdate</b>;</div>

<p>a javascript function that will be invoked before an AJAX update occurs.
The function signature is <code>function(id,options)</code> where 'id' refers to the ID of the grid view,
'options' the AJAX request options  (see jQuery.ajax api manual).</p>


<div class="detailHeader" id="blankDisplay-detail">
blankDisplay<span class="detailHeaderTag">
property
 (available since v1.1.7)
</span>
</div>

<div class="signature">
public string <b>$blankDisplay</b>;</div>

<p>the text to be displayed in an empty grid cell. This property will NOT be HTML-encoded when rendering. Defaults to an HTML blank.
This differs from <a href="CGridView.html#nullDisplay">nullDisplay</a> in that <a href="CGridView.html#nullDisplay">nullDisplay</a> is only used by <a href="CDataColumn.html">CDataColumn</a> to render
null data values.</p>


<div class="detailHeader" id="columns-detail">
columns<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$columns</b>;</div>

<p>grid column configuration. Each array element represents the configuration
for one particular grid column which can be either a string or an array.
<br/><br/>
When a column is specified as a string, it should be in the format of "name:type:header",
where "type" and "header" are optional. A <a href="CDataColumn.html">CDataColumn</a> instance will be created in this case,
whose <a href="CDataColumn.html#name">CDataColumn::name</a>, <a href="CDataColumn.html#type">CDataColumn::type</a> and <a href="CDataColumn.html#header">CDataColumn::header</a>
properties will be initialized accordingly.
<br/><br/>
When a column is specified as an array, it will be used to create a grid column instance, where
the 'class' element specifies the column class name (defaults to <a href="CDataColumn.html">CDataColumn</a> if absent).
Currently, these official column classes are provided: <a href="CDataColumn.html">CDataColumn</a>,
<a href="CLinkColumn.html">CLinkColumn</a>, <a href="CButtonColumn.html">CButtonColumn</a> and <a href="CCheckBoxColumn.html">CCheckBoxColumn</a>.</p>


<div class="detailHeader" id="cssFile-detail">
cssFile<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$cssFile</b>;</div>

<p>the URL of the CSS file used by this grid view. Defaults to null, meaning using the integrated
CSS file. If this is set false, you are responsible to explicitly include the necessary CSS file in your page.</p>


<div class="detailHeader" id="enableHistory-detail">
enableHistory<span class="detailHeaderTag">
property
 (available since v1.1.11)
</span>
</div>

<div class="signature">
public boolean <b>$enableHistory</b>;</div>

<p>whether to leverage the <a href="https://developer.mozilla.org/en/DOM/window.history">DOM history object</a>.  Set this property to true
to persist state of grid across page revisits.  Note, there are two limitations for this feature:
<ul>
   <li>this feature is only compatible with browsers that support HTML5.</li>
   <li>expect unexpected functionality (e.g. multiple ajax calls) if there is more than one grid/list on a single page with enableHistory turned on.</li>
</ul></p>


<div class="detailHeader" id="filter-detail">
filter<span class="detailHeaderTag">
property
 (available since v1.1.1)
</span>
</div>

<div class="signature">
public <a href="CModel.html">CModel</a> <b>$filter</b>;</div>

<p>the model instance that keeps the user-entered filter data. When this property is set,
the grid view will enable column-based filtering. Each data column by default will display a text field
at the top that users can fill in to filter the data.
Note that in order to show an input field for filtering, a column must have its <a href="CDataColumn.html#name">CDataColumn::name</a>
property set or have <a href="CDataColumn.html#filter">CDataColumn::filter</a> as the HTML code for the input field.
When this property is not set (null) the filtering is disabled.</p>


<div class="detailHeader" id="filterCssClass-detail">
filterCssClass<span class="detailHeaderTag">
property
 (available since v1.1.1)
</span>
</div>

<div class="signature">
public string <b>$filterCssClass</b>;</div>

<p>the CSS class name for the table row element containing all filter input fields. Defaults to 'filters'.</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CGridView.html#filter">filter</a></li>
</ul>
</div>

<div class="detailHeader" id="filterPosition-detail">
filterPosition<span class="detailHeaderTag">
property
 (available since v1.1.1)
</span>
</div>

<div class="signature">
public string <b>$filterPosition</b>;</div>

<p>whether the filters should be displayed in the grid view. Valid values include:
<ul>
   <li>header: the filters will be displayed on top of each column's header cell.</li>
   <li>body: the filters will be displayed right below each column's header cell.</li>
   <li>footer: the filters will be displayed below each column's footer cell.</li>
</ul></p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CGridView.html#filter">filter</a></li>
</ul>
</div>

<div class="detailHeader" id="filterSelector-detail">
filterSelector<span class="detailHeaderTag">
property
 (available since v1.1.13)
</span>
</div>

<div class="signature">
public string <b>$filterSelector</b>;</div>

<p>the jQuery selector of filter input fields.
The token '{filter}' is recognized and it will be replaced with the grid filters selector.
Defaults to '{filter}'.
<br/><br/>
Note: if this value is empty an exception will be thrown.
<br/><br/>
Example (adding a custom selector to the default one):
<pre>
 ...
 'filterSelector'=&gt;'{filter}, #myfilter',
 ...
</pre></p>


<div class="detailHeader" id="formatter-detail">
formatter<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public <a href="CFormatter.html">CFormatter</a> <a href="CGridView.html#getFormatter"><b>getFormatter</b></a>()<br/>public void <a href="CGridView.html#setFormatter"><b>setFormatter</b></a>(<a href="CFormatter.html">CFormatter</a> $value)</div>

<p>the formatter instance. Defaults to the 'format' application component.</p>


<div class="detailHeader" id="hasFooter-detail">
hasFooter<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
public boolean <a href="CGridView.html#getHasFooter"><b>getHasFooter</b></a>()</div>

<p>whether the table should render a footer.
This is true if any of the <a href="CGridView.html#columns">columns</a> has a true <a href="CGridColumn.html#hasFooter">CGridColumn::hasFooter</a> value.</p>


<div class="detailHeader" id="hideHeader-detail">
hideHeader<span class="detailHeaderTag">
property
 (available since v1.1.1)
</span>
</div>

<div class="signature">
public boolean <b>$hideHeader</b>;</div>

<p>whether to hide the header cells of the grid. When this is true, header cells
will not be rendered, which means the grid cannot be sorted anymore since the sort links are located
in the header. Defaults to false.</p>


<div class="detailHeader" id="loadingCssClass-detail">
loadingCssClass<span class="detailHeaderTag">
property
 (available since v1.1.1)
</span>
</div>

<div class="signature">
public string <b>$loadingCssClass</b>;</div>

<p>the CSS class name that will be assigned to the widget container element
when the widget is updating its content via AJAX. Defaults to 'grid-view-loading'.</p>


<div class="detailHeader" id="nullDisplay-detail">
nullDisplay<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$nullDisplay</b>;</div>

<p>the text to be displayed in a data cell when a data value is null. This property will NOT be HTML-encoded
when rendering. Defaults to an HTML blank.</p>


<div class="detailHeader" id="rowCssClass-detail">
rowCssClass<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$rowCssClass</b>;</div>

<p>the CSS class names for the table body rows. If multiple CSS class names are given,
they will be assigned to the rows sequentially and repeatedly. This property is ignored
if <a href="CGridView.html#rowCssClassExpression">rowCssClassExpression</a> is set. Defaults to <code>array('odd', 'even')</code>.</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CGridView.html#rowCssClassExpression">rowCssClassExpression</a></li>
</ul>
</div>

<div class="detailHeader" id="rowCssClassExpression-detail">
rowCssClassExpression<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$rowCssClassExpression</b>;</div>

<p>a PHP expression that is evaluated for every table body row and whose result
is used as the CSS class name for the row. In this expression, you can use the following variables:
<ul>
  <li><code>$row</code> the row number (zero-based)</li>
  <li><code>$data</code> the data model for the row</li>
  <li><code>$this</code> the grid view object</li>
</ul>
The PHP expression will be evaluated using <a href="CGridView.html#evaluateExpression">evaluateExpression</a>.
<br/><br/>
A PHP expression can be any PHP code that has a value. To learn more about what an expression is,
please refer to the <a href="http://www.php.net/manual/en/language.expressions.php">php manual</a>.</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CGridView.html#rowCssClass">rowCssClass</a></li>
</ul>
</div>

<div class="detailHeader" id="rowHtmlOptionsExpression-detail">
rowHtmlOptionsExpression<span class="detailHeaderTag">
property
 (available since v1.1.13)
</span>
</div>

<div class="signature">
public string <b>$rowHtmlOptionsExpression</b>;</div>

<p>a PHP expression that is evaluated for every table body row and whose result
is used as additional HTML attributes for the row. The expression should return an
array whose key value pairs correspond to html attribute and value.
In this expression, you can use the following variables:
<ul>
  <li><code>$row</code> the row number (zero-based)</li>
  <li><code>$data</code> the data model for the row</li>
  <li><code>$this</code> the grid view object</li>
</ul>
The PHP expression will be evaluated using <a href="CGridView.html#evaluateExpression">evaluateExpression</a>.
<br/><br/>
A PHP expression can be any PHP code that has a value. To learn more about what an expression is,
please refer to the <a href="http://www.php.net/manual/en/language.expressions.php">php manual</a>.</p>


<div class="detailHeader" id="selectableRows-detail">
selectableRows<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$selectableRows</b>;</div>

<p>the number of table body rows that can be selected. If 0, it means rows cannot be selected.
If 1, only one row can be selected. If 2 or any other number, it means multiple rows can be selected.
A selected row will have a CSS class named 'selected'. You may also call the JavaScript function
<code>$(gridID).yiiGridView('getSelection')</code> to retrieve the key values of the currently selected
rows (gridID is the DOM selector of the grid).</p>


<div class="detailHeader" id="selectionChanged-detail">
selectionChanged<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$selectionChanged</b>;</div>

<p>a javascript function that will be invoked after the row selection is changed.
The function signature is <code>function(id)</code> where 'id' refers to the ID of the grid view.
In this function, you may use <code>$(gridID).yiiGridView('getSelection')</code> to get the key values
of the currently selected rows (gridID is the DOM selector of the grid).</p>

<div class="SeeAlso">
<h4>See Also</h4>
<ul>
	<li><a href="CGridView.html#selectableRows">selectableRows</a></li>
</ul>
</div>

<div class="detailHeader" id="showTableOnEmpty-detail">
showTableOnEmpty<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$showTableOnEmpty</b>;</div>

<p>whether to display the table even when there is no data. Defaults to true.
The <a href="CGridView.html#emptyText">emptyText</a> will be displayed to indicate there is no data.</p>


<div class="detailHeader" id="updateSelector-detail">
updateSelector<span class="detailHeaderTag">
property
 (available since v1.1.7)
</span>
</div>

<div class="signature">
public string <b>$updateSelector</b>;</div>

<p>the jQuery selector of the HTML elements that may trigger AJAX updates when they are clicked.
These tokens are recognized: {page} and {sort}. They will be replaced with the pagination and sorting links selectors.
Defaults to '{page}, {sort}', that means that the pagination links and the sorting links will trigger AJAX updates.
Tokens are available from 1.1.11
<br/><br/>
Note: if this value is empty an exception will be thrown.
<br/><br/>
Example (adding a custom selector to the default ones):
<pre>
 ...
 'updateSelector'=&gt;'{page}, {sort}, #mybutton',
 ...
</pre></p>


<h2>Method Details</h2>

<div class="detailHeader" id="createDataColumn-detail">
createDataColumn()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected <a href="CDataColumn.html">CDataColumn</a> <b>createDataColumn</b>(string $text)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$text</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">the column specification string</td>
</tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol"><a href="CDataColumn.html">CDataColumn</a></td>
  <td class="paramDescCol">the column instance</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L409">framework/zii/widgets/grid/CGridView.php#409</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">createDataColumn</span><span style="color: #007700">(</span><span style="color: #0000BB">$text</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">'/^([\w\.]+)(:(\w*))?(:(.*))?$/'</span><span style="color: #007700">,</span><span style="color: #0000BB">$text</span><span style="color: #007700">,</span><span style="color: #0000BB">$matches</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">CException</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'The&nbsp;column&nbsp;must&nbsp;be&nbsp;specified&nbsp;in&nbsp;the&nbsp;format&nbsp;of&nbsp;"Name:Type:Label",&nbsp;where&nbsp;"Type"&nbsp;and&nbsp;"Label"&nbsp;are&nbsp;optional.'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">CDataColumn</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name</span><span style="color: #007700">=</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">]!==</span><span style="color: #DD0000">''</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">type</span><span style="color: #007700">=</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">3</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">5</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">=</span><span style="color: #0000BB">$matches</span><span style="color: #007700">[</span><span style="color: #0000BB">5</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p>Creates a <a href="CDataColumn.html">CDataColumn</a> based on a shortcut column specification string.</p>


<div class="detailHeader" id="getFormatter-detail">
getFormatter()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public <a href="CFormatter.html">CFormatter</a> <b>getFormatter</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol"><a href="CFormatter.html">CFormatter</a></td>
  <td class="paramDescCol">the formatter instance. Defaults to the 'format' application component.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L656">framework/zii/widgets/grid/CGridView.php#656</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">getFormatter</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_formatter</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_formatter</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">format</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_formatter</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p></p>


<div class="detailHeader" id="getHasFooter-detail">
getHasFooter()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public boolean <b>getHasFooter</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">boolean</td>
  <td class="paramDescCol">whether the table should render a footer.
This is true if any of the <a href="CGridView.html#columns">columns</a> has a true <a href="CGridColumn.html#hasFooter">CGridColumn::hasFooter</a> value.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L645">framework/zii/widgets/grid/CGridView.php#645</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">getHasFooter</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getHasFooter</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p></p>


<div class="detailHeader" id="init-detail">
init()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>init</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L337">framework/zii/widgets/grid/CGridView.php#337</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">init</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateSelector</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">CException</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'The&nbsp;property&nbsp;updateSelector&nbsp;should&nbsp;be&nbsp;defined.'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;if(empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterSelector</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">CException</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'The&nbsp;property&nbsp;filterSelector&nbsp;should&nbsp;be&nbsp;defined.'</span><span style="color: #007700">));<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]=</span><span style="color: #DD0000">'grid-view'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getAssetManager</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">publish</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">getPathOfAlias</span><span style="color: #007700">(</span><span style="color: #DD0000">'zii.widgets.assets'</span><span style="color: #007700">)).</span><span style="color: #DD0000">'/gridview'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">!==</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">.</span><span style="color: #DD0000">'/styles.css'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">registerCssFile</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cssFile</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initColumns</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p>Initializes the grid view.
This method will initialize required property values and instantiate <a href="CGridView.html#columns">columns</a> objects.</p>


<div class="detailHeader" id="initColumns-detail">
initColumns()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>initColumns</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L365">framework/zii/widgets/grid/CGridView.php#365</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">initColumns</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">===array())<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider&nbsp;</span><span style="color: #007700">instanceof&nbsp;</span><span style="color: #0000BB">CActiveDataProvider</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">attributeNames</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider&nbsp;</span><span style="color: #007700">instanceof&nbsp;</span><span style="color: #0000BB">IDataProvider</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;use&nbsp;the&nbsp;keys&nbsp;of&nbsp;the&nbsp;first&nbsp;row&nbsp;of&nbsp;data&nbsp;as&nbsp;the&nbsp;default&nbsp;columns<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getData</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">=</span><span style="color: #0000BB">array_keys</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$column</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">createDataColumn</span><span style="color: #007700">(</span><span style="color: #0000BB">$column</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!isset(</span><span style="color: #0000BB">$column</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]=</span><span style="color: #DD0000">'CDataColumn'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">createComponent</span><span style="color: #007700">(</span><span style="color: #0000BB">$column</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">visible</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;continue;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">===</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #007700">=</span><span style="color: #0000BB">$id</span><span style="color: #007700">.</span><span style="color: #DD0000">'_c'</span><span style="color: #007700">.</span><span style="color: #0000BB">$i</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]=</span><span style="color: #0000BB">$column</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">init</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p>Creates column objects and initializes them.</p>


<div class="detailHeader" id="registerClientScript-detail">
registerClientScript()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>registerClientScript</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L425">framework/zii/widgets/grid/CGridView.php#425</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">registerClientScript</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$id</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxUpdate</span><span style="color: #007700">===</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ajaxUpdate</span><span style="color: #007700">=</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ajaxUpdate</span><span style="color: #007700">=</span><span style="color: #0000BB">array_unique</span><span style="color: #007700">(</span><span style="color: #0000BB">preg_split</span><span style="color: #007700">(</span><span style="color: #DD0000">'/\s*,\s*/'</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxUpdate</span><span style="color: #007700">.</span><span style="color: #DD0000">','</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">,-</span><span style="color: #0000BB">1</span><span style="color: #007700">,</span><span style="color: #0000BB">PREG_SPLIT_NO_EMPTY</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ajaxUpdate'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$ajaxUpdate</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ajaxVar'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxVar</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'pagerClass'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagerCssClass</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'loadingClass'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">loadingCssClass</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'filterClass'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterCssClass</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'tableClass'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">itemsCssClass</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'selectableRows'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectableRows</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'enableHistory'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableHistory</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'updateSelector'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">updateSelector</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'filterSelector'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterSelector<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxUrl</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'url'</span><span style="color: #007700">]=</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">normalizeUrl</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxUrl</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxType</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'ajaxType'</span><span style="color: #007700">]=</span><span style="color: #0000BB">strtoupper</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ajaxType</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getRequest</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'ajaxType'</span><span style="color: #007700">]==</span><span style="color: #DD0000">'POST'&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableCsrfValidation</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'csrfTokenName'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">csrfTokenName</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'csrfToken'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCsrfToken</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enablePagination</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #DD0000">'pageVar'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getPagination</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">pageVar</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(array(</span><span style="color: #DD0000">'beforeAjaxUpdate'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'afterAjaxUpdate'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'ajaxUpdateError'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'selectionChanged'</span><span style="color: #007700">)&nbsp;as&nbsp;</span><span style="color: #0000BB">$event</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$event</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$event&nbsp;</span><span style="color: #007700">instanceof&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$event</span><span style="color: #007700">]=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$event</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">[</span><span style="color: #0000BB">$event</span><span style="color: #007700">]=new&nbsp;</span><span style="color: #0000BB">CJavaScriptExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">$event</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=</span><span style="color: #0000BB">CJavaScript</span><span style="color: #007700">::</span><span style="color: #0000BB">encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$options</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCoreScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'jquery'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCoreScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'bbq'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">enableHistory</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerCoreScript</span><span style="color: #007700">(</span><span style="color: #DD0000">'history'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerScriptFile</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">baseScriptUrl</span><span style="color: #007700">.</span><span style="color: #DD0000">'/jquery.yiigridview.js'</span><span style="color: #007700">,</span><span style="color: #0000BB">CClientScript</span><span style="color: #007700">::</span><span style="color: #0000BB">POS_END</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">registerScript</span><span style="color: #007700">(</span><span style="color: #0000BB">__CLASS__</span><span style="color: #007700">.</span><span style="color: #DD0000">'#'</span><span style="color: #007700">.</span><span style="color: #0000BB">$id</span><span style="color: #007700">,</span><span style="color: #DD0000">"jQuery('#</span><span style="color: #0000BB">$id</span><span style="color: #DD0000">').yiiGridView(</span><span style="color: #0000BB">$options</span><span style="color: #DD0000">);"</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Registers necessary client scripts.</p>


<div class="detailHeader" id="renderDataCell-detail">
renderDataCell()
<span class="detailHeaderTag">
method
(available since v1.1.16)
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>renderDataCell</b>(<a href="CGridColumn.html">CGridColumn</a> $column, integer $row)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$column</td>
  <td class="paramTypeCol"><a href="CGridColumn.html">CGridColumn</a></td>
  <td class="paramDescCol">The Column instance to</td>
</tr>
<tr>
  <td class="paramNameCol">$row</td>
  <td class="paramTypeCol">integer</td>
  <td class="paramDescCol"></td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L636">framework/zii/widgets/grid/CGridView.php#636</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">renderDataCell</span><span style="color: #007700">(</span><span style="color: #0000BB">$column</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderDataCell</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>A seam for people extending CGridView to be able to hook onto the data cell rendering process.
<br/><br/>
By overriding only this method we will not need to copypaste and modify the whole entirety of `renderTableRow`.
Or override `renderDataCell()` method of all possible CGridColumn descendants.</p>


<div class="detailHeader" id="renderFilter-detail">
renderFilter()
<span class="detailHeaderTag">
method
(available since v1.1.1)
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderFilter</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L532">framework/zii/widgets/grid/CGridView.php#532</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderFilter</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filter</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;tr&nbsp;class=\"</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterCssClass</span><span style="color: #007700">}</span><span style="color: #DD0000">\"&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFilterCell</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Renders the filter.</p>


<div class="detailHeader" id="renderItems-detail">
renderItems()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderItems</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L481">framework/zii/widgets/grid/CGridView.php#481</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderItems</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getItemCount</span><span style="color: #007700">()&gt;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">||&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">showTableOnEmpty</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;table&nbsp;class=\"</span><span style="color: #007700">{</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">itemsCssClass</span><span style="color: #007700">}</span><span style="color: #DD0000">\"&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderTableHeader</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_start</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderTableBody</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$body</span><span style="color: #007700">=</span><span style="color: #0000BB">ob_get_clean</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderTableFooter</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$body</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//&nbsp;TFOOT&nbsp;must&nbsp;appear&nbsp;before&nbsp;TBODY&nbsp;according&nbsp;to&nbsp;the&nbsp;standard.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"&lt;/table&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderEmptyText</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p>Renders the data items for the grid view.</p>


<div class="detailHeader" id="renderTableBody-detail">
renderTableBody()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderTableBody</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L569">framework/zii/widgets/grid/CGridView.php#569</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderTableBody</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getData</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$n</span><span style="color: #007700">=</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;tbody&gt;\n"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$n</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">0</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(</span><span style="color: #0000BB">$row</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;</span><span style="color: #0000BB">$row</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">$n</span><span style="color: #007700">;++</span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderTableRow</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'&lt;tr&gt;&lt;td&nbsp;colspan="'</span><span style="color: #007700">.</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns</span><span style="color: #007700">).</span><span style="color: #DD0000">'"&nbsp;class="empty"&gt;'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderEmptyText</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/td&gt;&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tbody&gt;\n"</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p>Renders the table body.</p>


<div class="detailHeader" id="renderTableFooter-detail">
renderTableFooter()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderTableFooter</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L546">framework/zii/widgets/grid/CGridView.php#546</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderTableFooter</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hasFilter</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filter</span><span style="color: #007700">!==</span><span style="color: #0000BB">null&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterPosition</span><span style="color: #007700">===</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">FILTER_POS_FOOTER</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$hasFooter</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getHasFooter</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$hasFilter&nbsp;</span><span style="color: #007700">||&nbsp;</span><span style="color: #0000BB">$hasFooter</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;tfoot&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$hasFooter</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFooterCell</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$hasFilter</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFilter</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tfoot&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Renders the table footer.</p>


<div class="detailHeader" id="renderTableHeader-detail">
renderTableHeader()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderTableHeader</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L501">framework/zii/widgets/grid/CGridView.php#501</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderTableHeader</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">hideHeader</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;thead&gt;\n"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterPosition</span><span style="color: #007700">===</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">FILTER_POS_HEADER</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFilter</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;tr&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderHeaderCell</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterPosition</span><span style="color: #007700">===</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">FILTER_POS_BODY</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFilter</span><span style="color: #007700">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/thead&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filter</span><span style="color: #007700">!==</span><span style="color: #0000BB">null&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterPosition</span><span style="color: #007700">===</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">FILTER_POS_HEADER&nbsp;</span><span style="color: #007700">||&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">filterPosition</span><span style="color: #007700">===</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">FILTER_POS_BODY</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;thead&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderFilter</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/thead&gt;\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Renders the table header.</p>


<div class="detailHeader" id="renderTableRow-detail">
renderTableRow()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>renderTableRow</b>(integer $row)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$row</td>
  <td class="paramTypeCol">integer</td>
  <td class="paramDescCol">the row number (zero-based).</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L593">framework/zii/widgets/grid/CGridView.php#593</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">renderTableRow</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$htmlOptions</span><span style="color: #007700">=array();<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowHtmlOptionsExpression</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">[</span><span style="color: #0000BB">$row</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowHtmlOptionsExpression</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'row'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #DD0000">'data'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$data</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$options</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$htmlOptions&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$options</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClassExpression</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dataProvider</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">data</span><span style="color: #007700">[</span><span style="color: #0000BB">$row</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$class</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClassExpression</span><span style="color: #007700">,array(</span><span style="color: #DD0000">'row'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$row</span><span style="color: #007700">,</span><span style="color: #DD0000">'data'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$data</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$n</span><span style="color: #007700">=</span><span style="color: #0000BB">count</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">))&gt;</span><span style="color: #0000BB">0</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$class</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rowCssClass</span><span style="color: #007700">[</span><span style="color: #0000BB">$row</span><span style="color: #007700">%</span><span style="color: #0000BB">$n</span><span style="color: #007700">];<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(!empty(</span><span style="color: #0000BB">$class</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">].=</span><span style="color: #DD0000">'&nbsp;'</span><span style="color: #007700">.</span><span style="color: #0000BB">$class</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$htmlOptions</span><span style="color: #007700">[</span><span style="color: #DD0000">'class'</span><span style="color: #007700">]=</span><span style="color: #0000BB">$class</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">CHtml</span><span style="color: #007700">::</span><span style="color: #0000BB">openTag</span><span style="color: #007700">(</span><span style="color: #DD0000">'tr'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$htmlOptions</span><span style="color: #007700">).</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">columns&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$column</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">renderDataCell</span><span style="color: #007700">(</span><span style="color: #0000BB">$column</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$row</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;/tr&gt;\n"</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p>Renders a table body row.</p>


<div class="detailHeader" id="setFormatter-detail">
setFormatter()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>setFormatter</b>(<a href="CFormatter.html">CFormatter</a> $value)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$value</td>
  <td class="paramTypeCol"><a href="CFormatter.html">CFormatter</a></td>
  <td class="paramDescCol">the formatter instance</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/zii/widgets/grid/CGridView.php#L666">framework/zii/widgets/grid/CGridView.php#666</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">setFormatter</span><span style="color: #007700">(</span><span style="color: #0000BB">$value</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_formatter</span><span style="color: #007700">=</span><span style="color: #0000BB">$value</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p></p>


</div><!-- end of content -->

<div id="apiFooter">
&copy; 2008-2013 by <a href="http://www.yiisoft.com">Yii Software LLC</a><br/>
All Rights Reserved.<br/>
</div><!-- end of footer -->

<script type="text/javascript">
/*<![CDATA[*/
$("a.toggle").toggle(function(){
	$(this).text($(this).text().replace(/Hide/,'Show'));
	$(this).parents(".summary").find(".inherited").hide();
},function(){
	$(this).text($(this).text().replace(/Show/,'Hide'));
	$(this).parents(".summary").find(".inherited").show();
});
$(".sourceCode a.show").toggle(function(){
	$(this).text($(this).text().replace(/show/,'hide'));
	$(this).parents(".sourceCode").find("div.code").show();
},function(){
	$(this).text($(this).text().replace(/hide/,'show'));
	$(this).parents(".sourceCode").find("div.code").hide();
});
$("a.sourceLink").click(function(){
	$(this).attr('target','_blank');
});
/*]]>*/
</script>

</div><!-- end of page -->
</body>
</html>